<?php

/**
 * Contains "Mvc" View class
 *
 * LICENSE: MIT
 *
 * @author Peter Pippinger
 * @category PP
 * @package PP_Mvc
 * @copyright Copyright (c) 2013 Peter Pippinger
 * @license http://opensource.org/licenses/MIT
 * @version 1.1.0
 * @since Class exists since release 1.0.0
 */

/**
 * "Mvc" View class
 *
 * Provides view basic class
 *
 * @author Peter Pippinger
 * @category PP
 * @package PP_Mvc
 * @copyright Copyright (c) 2013 Peter Pippinger
 * @license http://opensource.org/licenses/MIT
 * @version 1.1.0
 * @since Class exists since release 1.0.0
 */
class View
{
	/**
	 * Returns the output of evaled code as string.
	 *
	 * @param string $code        	
	 * @param array $context        	
	 * @return string
	 */
	public function evalToString($code, $context = array())
	{
		ob_start();
		eval($code);
		$string = ob_get_contents();
		ob_end_clean();
		return $string;
	}
}
